home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
clover2.h.z
/
clover2.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
26KB
|
781 lines
/**************************************************************************
* *
* Copyright (C) 1987, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
/*
* clover2.h -- board defines for common to clover2 platforms (IP5,IP17)
*/
#ifndef __SYS_CLOVER2_H__
#define __SYS_CLOVER2_H__
#ident "$Revision: 1.5 $"
#if !LOCORE
#include "sys/types.h"
#endif !LOCORE
/* MP BUS id definitions */
#define MPSR_BUSIDCPU 0x7 /* 0-7 are cpu slots */
#define MPSR_BUSIDFIFO 0x9
#define MPSR_BUSIDGM 0xc /* GM */
#define MPSR_BUSIDIO2F 0xf /* IO2 in slot F */
#define MPSR_BUSIDIO2E 0xe /* IO2 in slot E */
/*
* CPU type definitions for assembly code. The C structures in "invent.h"
* cause assembler errors.
*/
#define R2300BOARD 1
#define IP4BOARD 2
#define IP5BOARD 3
#define IP6BOARD 4
#define IP7BOARD 5
#define IP9BOARD 6
/* CPU type definitions for cputype */
#define CPU_IP5 5 /* 16 Mhz multiprocessor */
#define CPU_IP7 7 /* 25 Mhz multiprocessor */
#define CPU_IP9 9 /* 25 Mhz singleprocessor */
#define CPU_IP17 17 /* 50 Mhz R4000 uniprocessor */
/*
* Signetics 2681 DUART registers
*/
#if !LOCORE && !STANDALONE
struct cn_chan {
unchar cnc_mode; u_char pad0[15];
unchar cnc_stat; u_char pad1[15];
unchar cnc_cmd; u_char pad2[15];
unchar cnc_data; u_char pad3[15];
};
#define cnc_clockselect cnc_stat
struct cn_reg {
struct cn_chan cn_chan_a;
unchar cn_inport_change; unchar pad0[15];
unchar cn_isr; unchar pad1[15];
unchar cn_ctupper; unchar pad2[15];
unchar cn_ctlower; unchar pad3[15];
struct cn_chan cn_chan_b;
unchar cn_snipe; unchar pad4[15];
unchar cn_inport; unchar pad5[15];
unchar cn_startcount; unchar pad6[15];
unchar cn_stopcount; unchar pad7[15];
};
/*
* Sync Bus Controller Chip (SBCC) registers
*
* Note that the processor does 32 bit cycles to the SBCC, but only the
* the low order 16 bits of the data is significant.
*/
struct sbcc {
uint level[14]; /* 0x00: CPU int levels for ids 0-D */
uint fill0[2];
uint status[14]; /* 0x40: Status regs for ids 0-D */
uint fill1[2];
uint elevel; /* 0x80: CPU int lvl for id E (VME) */
uint fill2[7];
uint flevel; /* 0xa0: CPU int lvl for id F (VME) */
uint fill3[3];
uint overrun; /* 0xb0: interrupt vector overrun */
uint fill4[3];
uint id; /* 0xc0: sync bus id */
uint eintenable; /* 0xc4: VME int enable for id E */
uint eintpending; /* 0xc8: VME int pending for id E */
uint fintenable; /* 0xcc: VME int enable for id F */
uint fintpending; /* 0xd0: VME int pending for id F */
uint idintenable; /* 0xd4: int enable mask by id */
uint idintpending; /* 0xd8: int pending mask by id */
uint fill9[8];
union sbcc_intxmit_u {
uint xmit;
struct intxmit1_s { /* for IP5 */
uint :16, /* 0xfc: filler */
x_busy :1, /* enable/busy bit */
:2,
x_ot :1, /* destination type */
x_destid:4, /* destination id */
x_status:8; /* interrupt status */
} xmit1_s;
struct intxmit2_s { /* for IP7 */
uint :8, /* 0xfc: filler */
x_busy :1, /* enable/busy bit */
:2,
x_ot :1, /* destination type */
x_destid:4, /* destination id */
:8,
x_status:8; /* interrupt status */
} xmit2_s;
} intxmit_u;
};
#define intxmit intxmit_u.xmit
#define xmit1_busy xmit1_s.x_busy
#define xmit1_ot xmit1_s.x_ot
#define xmit1_destid xmit1_s.x_destid
#define xmit1_status xmit1_s.x_status
#define intxmit1_busy intxmit_u.xmit1_busy
#define intxmit1_ot intxmit_u.xmit1_ot;
#define intxmit1_destid intxmit_u.xmit1_destid;
#define intxmit1_status intxmit_u.xmit1_status;
#define xmit2_busy xmit2_s.x_busy
#define xmit2_ot xmit2_s.x_ot
#define xmit2_destid xmit2_s.x_destid
#define xmit2_status xmit2_s.x_status
#define intxmit2_busy intxmit_u.xmit2_busy
#define intxmit2_ot intxmit_u.xmit2_ot;
#define intxmit2_destid intxmit_u.xmit2_destid;
#define intxmit2_status intxmit_u.xmit2_status;
#endif !LOCORE && !STANDALONE
/* SBCC Level bits */
#define SBCC_LEVELBIT3 0x01
#define SBCC_LEVELBIT4 0x02
#define SBCC_LEVELBIT5 0x04
#define SBCC_LEVELBIT7 0x08
#define SBCC_LEVELBIT8 0x10
/* Destination Types (intxmit_ot) */
#define SINGLE 0
#define GROUP 1
/* Destination Group id masks (intxmit_destid) */
#define GROUP0 0x4
#define GROUP1 0x8
/*
* IO2 Board Addresses
*/
#define SOUND_DAT_ADDR 0xb7f00000 /* SAA1099 stereo sound generator */
#define SOUND_CMD_ADDR 0xb7f00010
#define SCSI0A_ADDR 0xb7f08007 /* SCSI0 WD33C93A indirect register */
#define SCSI0D_ADDR 0xb7f08107 /* SCSI0 WD33C93A data register */
#define SCSI1A_ADDR 0xb7f0c007 /* SCSI1 WD33C93A indirect register */
#define SCSI1D_ADDR 0xb7f0c107 /* SCSI1 WD33C93A data register */
#define NVRAM_ADDR 0xb7f10000 /* Non-volatile RAM address */
#define RT_CLOCK_ADDR (NVRAM_ADDR+(0x7ff<<3))
/* This address is in the NVRAM and is
* reserved by convention to send the
* pattern recognition bits to. */
#define VME_RMW_ADDR 0xb7c20000 /* VME R-M-W flag */
#define LOGRAM_ADDR 0xb7d00000 /* Error logging ram */
#define ETMEM_ADDR 0xb7e00000 /* Start of ENET 1Mb DRAM */
#define ETIO_ADDR 0xb7fc0002 /* Start of ENET IO addr */
#define LANCERDP_ADDR 0xb7fc0002 /* Lance DAP reg */
#define LANCERAP_ADDR 0xb7fc000a /* Lance RAP reg */
#define LANCEHOLD_ADDR 0xb7ff8000 /* Lance Interrupt Holdoff Counter */
#define LANCERAM_ADDR 0xb7ff4000 /* Lance ethernet ring ram */
#define NVRAM_RESET 0xb7f18000 /* Reset Non-volatile RAM control */
#define IOLED_ADDR 0xb7f20000 /* IO brd LED/int status reg (7 bits) */
#define SCSI0FLUSH_ADDR 0xb7f30000 /* Flush SCSI0 DMA registers (w) */
#define SCSI1FLUSH_ADDR 0xb7f34000 /* Flush SCSI1 DMA registers (w) */
#define SWITCH_ADDR 0xb7f30000 /* Switch register byte 1 (r) */
#define SCSI0CNTR_ADDR 0xb7f54000 /* SCSI 0 counter */
#define SCSI1CNTR_ADDR 0xb7f58000 /* SCSI 1 counter */
#define IOINTVECTOR 0xb7f60000 /* Interrupt dest and status table */
#define INTVEC_WPAD 2 /* Word offset to next int vec */
#define INTMASK_ADDR 0xb7fe0000 /* Read for interrupt mask/pend */
#define CLEARMASK_ADDR 0xb7fe0000 /* Write 1 to disable interrupt */
#define SETMASK_ADDR 0xb7fe8000 /* Write 1 to enable interrupt */
#define MEMERR_ADDR 0xb7f80000 /* Memory error register */
#define A24MAPA_ADDR 0xb7fa0000 /* A24 mapper address register */
#define A24MAPD_ADDR 0xb7fb0000 /* A24 mapper data */
#define A24MAPW_ADDR 0xb7fa0000 /* Write to mapper address */
#define A24MAPR_ADDR 0xb7fb0000 /* Pointer to mapper's entry */
#define A24MAPDATA_ADDR 0xb7f28000 /* Get read data */
#define MODE_ADDR 0xb7f40000 /* Mode register */
#define MODE_BYTE0 0xb7f40000 /* BE byte addr of leftmost byte */
#define MODE_BYTE1 0xb7f40001
#define MODE_BYTE2 0xb7f40002
#define MODE_BYTE3 0xb7f40003 /* BE byte addr of rightmost byte */
#define IOTIMER_ADDR 0xb7f44000 /* Free running timer register(IO3) */
#define MPBERR0_ADDR 0xb7f48000 /* Bus error or timeout address */
#define MPBERR1_ADDR 0xb7f4c000 /* Write back bus error address */
#define ENETPROM_ADDR 0xb7ff0000 /* Interrupt/DBE status, Enet ID prom */
#define INTRDBE_ADDR 0xb7ff0000 /* Interrupt/DBE status word */
#define ENETID_ADDR 0xb7ff0002 /* Enet ID prom, 1st byte */
#define ENETID_BPAD 8
#define ID_ADDR 0xb7fffff0 /* IO board ID */
#define ID2_ADDR 0xb7fffff3 /* IO board secondary ID */
#define ESPACE_OFFSET 0x400000 /* sub from to get equiv in E */
/*
* IO3 prom address
*/
#define IO3_PROM_ADDR 0xb7e00004 /* 256KB of Diagnostic Proms */
#define IO2_REV1_ID 1 /* IO2 rev1 board */
#define IO2_REV2_ID 2 /* SCSI location moved up in dma mapper
, A32 can also goes thru mapper */
#define IO3_REV1_ID 3 /* 2 SCSI controller, Enet copy can be
DMA-ed */
#define IO3_REV1_ID2 0x1 /* original IO3 ID2_ADDR bit 0 is 1 */
#define IO3_REV2_ID2 0x0 /* biendian IO3 ID2_ADDR bit 0 is 0 */
/*
* MC1 defines
*/
#define MODE0_ADDR 0xb7f40000 /* Mode byte 0: VME A32 control */
#define MODE1_ADDR 0xb7f44001 /* Mode byte 1: Memory control */
#define MODE2_ADDR 0xb7f48002 /* Mode byte 2: Memory check bits */
#define MODE3_ADDR 0xb7f4c003 /* Mode byte 3: PROM/SCSI and ENET */
#define MC1LED_ADDR 0xb7f20000 /* IO brd LED/int status reg (7 bits) */
#define MC1INTENABLE 0xb7f28000 /* Interrupt enable mask (8 bits) */
#define MC1SWITCH_ADDR 0xb7f30000 /* Switch register byte 1 (r) */
#define MC1ID_ADDR 0xb7f38000 /* Serial chasis ID PROM */
#define MC1INTVECTOR 0xb7f60000 /* Interrupt dest and status table */
#ifdef STANDALONE
/*
* STANDALONE compatibility defines so scsi.c will compile
*/
#define LED_REG LED_ADDR
#define MODE3 MODE3_ADDR
#define A24MAPA A24MAPA_ADDR
#define A24MAPD A24MAPD_ADDR
#endif STANDALONE
/* VME I/O space defines */
#define VME_A16NPBASE 0xb7c00000 /* a16 non-privileged address space */
#define VME_A16SBASE 0xb7c10000 /* a16 supervisor address space */
#define VME_A24NPBASE 0xb2000000 /* a24 non-privileged address space */
#define VME_A24SBASE 0xb3000000 /* a24 supervisor address space */
#define VME1_A24NPBASE 0x52000000 /* a24 non-privileged address space,
adapter 1 */
#define VME1_A24SBASE 0x53000000 /* a24 supervisor address space,
adapter 1 */
#define VME1_A24NPVBASE 0xf0000000 /* a24 non-privileged virtual space,
adapter 1 */
#define VME1_A24SVBASE 0xf1000000 /* a24 supervisor virtual space,
adapter 1 */
#define VME_A32NPBASE 0x20000000 /* a32 non-privileged address space */
#define VME_A32SBASE 0x30000000 /* a32 supervisor space */
#define VME_A32NPVBASE 0xd8000000 /* a32 non-privileged virtual space */
#define VME_A32SVBASE 0xe8000000 /* a32 supervisor virtual space */
#define VME1_A32NPBASE 0x60000000 /* a32 non-privileged address space,
adapter 1 */
#define VME1_A32SBASE 0x70000000 /* a32 supervisor space, adapter 1 */
#define VME1_A32NPVBASE 0xd0000000 /* a32 non-privileged virtual space
adapter 1 */
#define VME1_A32SVBASE 0xe0000000 /* a32 supervisor virtual space,
adapter 1 */
#define VME_A16NPSIZE 0x00010000 /* a16 non-privileged addr sp size */
#define VME_A16SSIZE 0x00010000 /* a16 supervisor addr sp size */
#define VME_A24NPSIZE 0x01000000 /* a24 non-privileged addr sp size */
#define VME_A24SSIZE 0x01000000 /* a24 supervisor addr sp size */
#define VME_A32NPSIZE 0x08000000 /* a32 non-privileged addr sp size */
#define VME_A32SSIZE 0x08000000 /* a32 supervisor addr sp size */
#if STANDALONE
#define VME_A16NPAMOD 0x29 /* a16 non-privileged addr modifier */
#define VME_A16SAMOD 0x2d /* a16 supervisor addr modifier */
#define VME_A24NPAMOD 0x39 /* a24 non-privileged addr modifier */
#define VME_A24SAMOD 0x3d /* a24 supervisor addr modifier */
#define VME_A32NPAMOD 0x09 /* a32 non-privileged addr modifier */
#define VME_A32SAMOD 0x0d /* a32 supervisor addr modifier */
#define VME_A32NPBLOCK 0x0b /* a32 non-privileged block transfer */
/* MC1 Memory address register bits */
#define MERR_ECC 0x80000000 /* 32 bit ECC == 0, 64 bit ECC == 1*/
#define MERR_PMECCM 0x40000000 /* Parity mem == 0, ECC mem == 1 */
#define MEM_PAERR 0x10000000 /* Parity error == 0 */
#define MEM_MODUMASK 0x0xf80000 /* 8 meg module number */
#define MEM_PEADDMASK 0x0ffffff0 /* Parity error word address */
#define MEM_RW 0x00000002 /* Read == 0, Write == 1 */
#define MERR_NEXIST 0x00000001 /* Non-existant memory error == 1 */
#endif /* STANDALONE */
#ifdef LANGUAGE_C
/* Interrupt vector table entry */
struct mc1vector {
#ifdef MIPSEB
uint statword;
uint fill;
#endif
#ifdef MIPSEL
uint fill;
uint statword;
#endif
};
typedef struct scuzzy {
volatile u_char *d_addr; /* address register */
volatile u_char *d_data; /* data register */
volatile u_int *dma_lo; /* dma lo */
volatile u_int *dma_flush; /* dma flush */
unsigned char d_initflags; /* initial flags for d_flags */
unsigned char d_clock; /* value for clock register on WD chip */
} scuzzy_t;
#endif /* LANGUAGE_C */
/* Masks for interrupt status word */
#define STATUS_MASK 0x00ff
#define DESTID_MASK 0x0f00
#define DESTID_SHIFT 8
#define INTSTAT_BERR 0x1000 /* Indicates MP bus error during DMA */
#if !LOCORE
/* Interrupt mask word */
union intmask {
struct {
unchar mask;
unchar pending;
short unused;
} u_fields;
uint u_val;
};
/* IO2 MPBERR1 register */
union mpberr1 {
struct {
ushort wbaddr; /* XXX EL */
uint :7,
valid:1,
:1,
read:1,
errtype:2,
busmaster:4;
} u_fields;
uint u_val;
};
#define mpbe1_wbaddr(m) ((m) >> 16)
#define mpbe1_valid(m) ((m) & 0x00000100)
#define mpbe1_read(m) ((m) & 0x00000040)
#define mpbe1_errtype(m) (((m) & 0x00000030) >> 4)
#define mpbe1_busmaster(m) ((m) & 0x0000000f)
#define MPBERR1_CACHE 0
#define MPBERR1_DMA 1
#define MPBERR1_3WAY 2
#define MPBERR1_PIO 3
#endif /* !LOCORE */
/* MODE register definitions */
/* MODE0 bits definition */
#define M0_SLAVE 0x00 /* VME A32 slave address */
#define M0_MASTER 0x01 /* VME A32 master address */
/* MODE1 bit definitions */
#define M1_FORCE 0x01 /* Force check bits in MODE2 */
#define M1_VMERESET 0x02 /* Assert VME Bus reset */
#define M1_LE64 0x10 /* swizzle and swap words */
#define M1_LE32 0x20 /* swizzle words */
/* MODE2 bit definitions - these are ECC check bits for use w/ M1_FORCE */
/* MODE3 bit definitions - On-board ethernet */
#define ET_NRESET 0x01
#define ET_TEST 0x02 /* pock test pin on LANCE */
#define ET_PARENA 0x04 /* enable parity checking */
#define ET_BADPAR 0x08 /* force bad parity */
#define M3_PROM 0x40 /* IO2 only, SCSI : 0 / PROM : 1 */
#define SCSI0_RESET M3_PROM /* SCSI0 reset */
#define SCSI1_RESET 0x80 /* IO3 only, SCSI1 reset */
#ifndef STANDALONE
/* use these macros while accessing MODE3 bits */
extern lock_t hwreg_lock;
#define HWREG_USELOCK() int hwreg_spl
#define HWREG_LOCK() hwreg_spl = splock(hwreg_lock)
#define HWREG_UNLOCK() spunlock(hwreg_lock, hwreg_spl)
#endif
/* A24/SCSI Mapper register definitions */
#define MAPA_MASK 0x00fff000 /* mask for A24 mapper adddress */
#define MAPA_SHIFT 3 /* shift for A24 mapper adddress */
#define MAPD_MASK 0x0ffff000 /* mask for A24 data adddress */
#define MAPA_SHIFT 3 /* shift for A24 data adddress */
/*
* The map is broken up as follows:
* IO2 rev2 DMA map allocation
* -------------------- 0x1fff Notes: The SCSI map locations are
* | 64 SCSI | enforced by hardware. A32 could
* -------------------- 0x1fc0 use the rest of the map, but A24
* | 6080 A32 | MUST use the lower part of the map,
* -------------------- 0x07ff so this is enforced by software.
* | 2048 A24 | Only 0x7ff map entries (rather than
* -------------------- 0x0000 0xfff) are allotted to A24 since
* some hardware already uses the high
* order addresses.
* IO3 DMA map allocation
*
* -------------------- 0x1fff
* | 64 SCSI0 |
* -------------------- 0x1fbf
* | 64 SCSI1 |
* -------------------- 0x1f7f
* | 128 unused |
* -------------------- 0x1eff
* | 256 ENET |
* -------------------- 0x1dff
* | 5632 A32 |
* -------------------- 0x07ff
* | 2048 A24 |
* -------------------- 0x0000
*
* Note: SCSI/ENET mappings are enforced by hardware.
* A24 mapping is limited to 0x800 entries since IO2/3 does not respond
* to any A24 address with the highest bit on(the CMC enet board used that addr
* range). Otherwise it would have 0x1000 entries.
* For A32, the MSB bit has to be set in order for the mapper to be activated,
* the next 3 bits must match bit 28-30 of the MODE register which are set to 0,
* the next 3 bits are don't care, then the next 13 are decoded by the mapper.
* Therefore A32 can use any of the entries in the 8K mapper, so software has
* to make sure that it doesn't overlap with others.
*
*/
#define BASE_A24MAPREG (1) /* because maps can't start at zero */
#define NUM_A24MAPREG (2048-1)/* A24 map size */
#define BASE_A32MAPREG (BASE_A24MAPREG+NUM_A24MAPREG)
/* for IO2 rev 1 */
#define IO2NUM1_A32MAPREG (1820) /* A32 map size for IO2 rev 1 */
#define IO2BASE1_SCSIMAPREG (BASE_A32MAPREG+IO2NUM1_A32MAPREG)
/* for IO2 rev 2 */
#define IO2NUM2_A32MAPREG (6080) /* A32 map size for IO2 rev 2 */
#define IO2BASE2_SCSIMAPREG (BASE_A32MAPREG+IO2NUM2_A32MAPREG)
/* for IO3 */
#define IO3NUM1_A32MAPREG (5632) /* A32 map size for IO3 */
#define IO3BASE1_ENETMAPREG (BASE_A32MAPREG+IO3NUM1_A32MAPREG)
#define NUM_ENETMAPREG (256) /* enet map size */
#define UNUSED_MAPREG (IO3BASE1_ENETMAPREG+NUM_ENETMAPREG)
#define NUM_UNUSEDMAPREG (128) /* unused map size */
#define IO3BASE1_SCSI1MAPREG (UNUSED_MAPREG+NUM_UNUSEDMAPREG)
#define NUM_SCSIMAPREG (64) /* SCSI map size for all IO board versions */
#define IO3BASE1_SCSI0MAPREG (IO3BASE1_SCSI1MAPREG+NUM_SCSIMAPREG)
#define A32_MAPPED 0x80000000 /* must be ORed in to the A32 DMA addr*/
/* DMALO bits */
#define DMA_READFLAG 0x00008000 /* indicates read */
#define DMA_BUSERR 0x80000000 /* indicates MP bus error occured */
#if !LOCORE
union mapentry {
struct {
short maploc;
short page;
} u_fields;
int u_val;
};
#endif
/* IO2 VME/SCSI interrupt pending and enable masks */
#define INTMASK_SCSI 0x01
#define INTMASK_SCSI_ENET 0x01 /* local intr, level 0 */
#define INTMASK_VME1 0x02 /* VME levels 1-7 */
#define INTMASK_VME2 0x04
#define INTMASK_VME3 0x08
#define INTMASK_VME4 0x10
#define INTMASK_VME5 0x20
#define INTMASK_VME6 0x40
#define INTMASK_VME7 0x80
#define INTMASK_VMEALL 0xfe
/* added bits for IO3, IO3 can resort to IO2 interrupt scheme or
** the new sheme which ignore level 0
*/
#define INTMASK_SCSI0 0x100 /* SCSI0 intr, level 8 */
#define INTMASK_SCSI1 0x200 /* SCSI1 intr, level 9 */
#define INTMASK_IO3ENET 0x400 /* ENET intr, level 10 */
/* IO2 Interrupt vector 0 bits definitions */
/* If not SCSI, ENETERR, ENETREQ then it is PROM DMA */
#define SCSI0REQ_MASK 0x01 /* active low */
#define SCSI1REQ_MASK 0x02 /* active low */
#define ENETERR_MASK 0x02 /* active low */
#define ENETREQ_MASK 0x04 /* active low */
#define SCSI_ET_REQLV 0 /* scsi/if_et intr IRQ is 0 */
/* IO3 Interrupt vector 0 bits definitions,
** if in the compatibilty mode
*/
#define SCSI1REQ_MASK 0x02 /* SCSI1 intr on IO3, instead of ENET
parity err, active low */
/* defines for ENETPROM_ADDR */
#define EMSK_ENETPROM 0x80 /* Lance int. Hold off */
#define EI_ENETPROM 0x40 /* Lance int. w/o hold off */
#define SC1I_ENETPROM 0x20
#define SC0I_ENETPROM 0x10
#define VBE_ENETPROM 0x08
#define EBE_ENETPROM 0x04 /* Enet bus error, active lo */
#define SC1BE_ENETPROM 0x02
#define SC0BE_ENETPROM 0x01
/*
* ID interrupt pending, enable, and overrun masks
*
* These differ on the IP5 and the IP7; rather than use separate defines,
* we primarily use the more coherent IP5 values below, and use the
* following macro to convert from one to the other where necessary.
*/
#define IP517_TO_IP79(m) (((m << 8) & 0xff0000) | (m & 0xff))
#define IP79_TO_IP517(m) (((m >> 8) & 0x00ff00) | (m & 0xff))
#define INTMASK_ID0 0x0001
#define INTMASK_ID1 0x0002
#define INTMASK_ID2 0x0004
#define INTMASK_ID3 0x0008
#define INTMASK_ID4 0x0010
#define INTMASK_ID5 0x0020
#define INTMASK_ID6 0x0040
#define INTMASK_ID7 0x0080
#define INTMASK_ID8 0x0100
#define INTMASK_ID9 0x0200
#define INTMASK_IDA 0x0400
#define INTMASK_IDB 0x0800
#define INTMASK_IDC 0x1000
#define INTMASK_IDD 0x2000
#define INTMASK_IDE 0x4000
#define INTMASK_IDF 0x8000
#define INTMASK_IDALL 0xffff /* All ID's */
#define INTMASK_IDCPU 0x00ff /* CPUs use IDs 0-7 */
#define INTMASK_IDIO2 0xc000 /* Either of ID's E and F */
#define INTMASK_IDFIFO INTMASK_ID9 /* GM3 FIFO interrupt uses ID 9 */
#define INTMASK_IDGM INTMASK_IDC /* GM2 and GM3 use ID C */
#define INTMASK_IDOTHER 0x2d00 /* Nobody uses IDs 8, A, B, D */
#define PENDMASK 0x00ff /* mask E and F level pending */
/*
* Read-Only bits in LED register
*/
#define IOLED_INT 0x20 /* interrupt being processed by IO2 */
#define IOLED_RMW 0x40 /* VME RMW flag */
#define IOLED_IDDATA 0x80 /* bit-wise data from chassis PROM */
/*
* MP configuration block, one per CPU
*/
#define MPCONF_MAGIC 0xDEADBEEF
#define MPCONF_SIZE (32*4)
#if !LOCORE
struct mpconf_blk {
int mpconf_magic;
int mp_checksum; /* 2-complement 32 bit checksum of 32 words */
int phys_id; /* CPU physical ID */
int vir_id; /* CPU virtual ID */
int errno; /* bootstrap error */
int (* launch)(); /* routine to start bootstrap */
int (* rendezvous)();/* call this, when done launching*/
int *bevutlb; /* address of bev utlb exception handler */
int *bevnormal; /* address of bev normal exception handler */
int *bevecc; /* address of bev cache error handler (R4000 only) */
int *bevutlb_save; /* address of bev utlb exception handler */
int *bevnormal_save;/* address of bev normal exception handler */
int *bevecc_save; /* address of bev cache error handler (R4000 only) */
int icache_size; /* 1st level Icache size for this CPU */
int dcache_size; /* 1st level Dcache size for */
int nonbss;
int filler[16];
};
#endif !LOCORE
/*
* ip9 LED setting for csu.s (realstart)
*/
#define PON_IP9_MEM_BASE_CK 0x20
#define PON_IP9_NO_MC2 0x21
#define PON_SWITCH_PATTERN 0x81
#define SYMMON_SWITCH_PATTERN 0x82
#define NODIAG_SWITCH_PATTERN 0x84 /*if set no diag other than 1st cache*/
#define MPDEBUG_SWITCH_PATTERN 0x88
#define PREDATOR_SWITCH_PATTERN 0X40
/*
* Predator signal defines
*/
#define SP3_STROBE 0x01
#define SP3_ENABLE 0x02
#define SP3_DATA_OFF 0x04
#define SP3_DATA 0x04
#define SP3_SELECTA 0x08
#define SP3_OFF 0x04 /* DATA line high turns off */
#define SP3_ON 0x0
#define SP3_MAXPROCS 8 /* Sp3 handles 8 processors */
/* defines for virtual mapping of VME space */
#define VMEPHYS_MASK 0x0fffffff
#define VME1_NPA32LO (VME1_A32NPVBASE - K2BASE) >> BPCSHIFT
#define VME1_NPA32HI (VME1_A32NPVBASE + VME_A32SSIZE - K2BASE) >> BPCSHIFT
#define VME0_NPA32HI (VME_A32NPVBASE + VME_A32SSIZE - K2BASE) >> BPCSHIFT
#define VME1_SPA32HI (VME1_A32SVBASE + VME_A32SSIZE - K2BASE) >> BPCSHIFT
#define VME0_SPA32HI (VME_A32SVBASE + VME_A32SSIZE - K2BASE) >> BPCSHIFT
#define VME1_SPA24HI (VME1_A24SVBASE + VME_A24SSIZE - K2BASE) >> BPCSHIFT
#ifndef STANDALONE
extern int vme_adapter(volatile void *addr);
#endif
/*
* non-volatile ram addresses
* NOTE: everything must fit within 2kb for the Smart Watch. Each
* byte at a even longword boundary.
* ALSO NOTE: we need to reserve the last 3 bytes of NV RAM for valid, checksum
* and for use in setting the real-time clock.
*/
#define NV_OFFSET 8
#define NVLEN_MAX (2045 * NV_OFFSET) /* last 3 bytes reserved */
#define NVOFF_BASE 0
/*
* netaddr is used by network software to determine the internet
* address, it should be a string containing the appropriate
* network address in "." format
*/
#define NVOFF_NETADDR (NVOFF_BASE)
#define NVLEN_NETADDR 16
/*
* lbaud/rbaud are the initial baud rates for the duart
* (e.g. "9600")
*/
#define NVOFF_LBAUD (NVOFF_NETADDR+(NVLEN_NETADDR*NV_OFFSET))
#define NVLEN_LBAUD 5
#define NVOFF_RBAUD (NVOFF_LBAUD+(NVLEN_LBAUD*NV_OFFSET))
#define NVLEN_RBAUD 5
/*
* bootfile is the initial program loaded on an autoboot
* (e.g. "bfs(0)mipsboot_le")
*/
#define NVOFF_BOOTFILE (NVOFF_RBAUD+(NVLEN_RBAUD*NV_OFFSET))
#define NVLEN_BOOTFILE 50
/*
* bootmode controls autoboots/warm starts/command mode on reset
* "a" => autoboot on reset
* "w" => warm start if restart block correct, else autoboot
* anything else cause entry to command mode
*/
#define NVOFF_BOOTMODE (NVOFF_BOOTFILE+(NVLEN_BOOTFILE*NV_OFFSET))
#define NVLEN_BOOTMODE 1
/*
* console controls what consoles are enabled at power-up
* 'a' indicates "all" consoles
* 'r' indicates both local and remote uarts
* anything else indicates only local uart
*/
#define NVOFF_CONSOLE (NVOFF_BOOTMODE+(NVLEN_BOOTMODE*NV_OFFSET))
#define NVLEN_CONSOLE 1
/*
* state maintains the current validity of the tod clock and
* non-volatile ram
* Note; this byte is not used in the new lay-out, we have to keep it here
* for compatibility reason. The byte that maintains the NVRAM validity is
* now moved to the end.
*/
#define NVOFF_STUB (NVOFF_CONSOLE+(NVLEN_CONSOLE*NV_OFFSET))
#define NVLEN_STUB 1
/*
* failcode is used by the power-on diagnostics to save a failure
* code for use by service techs
*/
#define NVOFF_FAILCODE (NVOFF_STUB+(NVLEN_STUB*NV_OFFSET))
#define NVLEN_FAILCODE 1
/*
* root identifies the disk partition that the root device will reside on.
*/
#define NVOFF_ROOT (NVOFF_FAILCODE+(NVLEN_FAILCODE*NV_OFFSET))
#define NVLEN_ROOT 20
/*
* keybd indicates the type of keyboard that is attached
*/
#define NVOFF_KEYBD (NVOFF_ROOT+(NVLEN_ROOT*NV_OFFSET))
#define NVLEN_KEYBD 10
#define NVOFF_MONITOR (NVOFF_KEYBD+(NVLEN_KEYBD*NV_OFFSET))
#define NVLEN_MONITOR 4
#define NVOFF_SYNC_ON_GREEN (NVOFF_MONITOR+(NVLEN_MONITOR*NV_OFFSET))
#define NVLEN_SYNC_ON_GREEN 1
#define NVOFF_DISKLESS (NVOFF_SYNC_ON_GREEN+(NVLEN_SYNC_ON_GREEN*NV_OFFSET))
#define NVLEN_DISKLESS 1
#define PASSWD_LEN 8
/*
* password_key is an encrypted key for protecting manual mode
*/
#define NVOFF_PASSWD_KEY (NVOFF_DISKLESS+(NVLEN_DISKLESS*NV_OFFSET))
#define NVLEN_PASSWD_KEY (2*PASSWD_LEN+1)
#define NVLEN_TOTAL (NVOFF_PASSWD_KEY+(NVLEN_PASSWD_KEY*NV_OFFSET))
#if NVLEN_TOTAL > NVLEN_MAX
# include "error -- non-volatile ram overflow"
#endif
/*
* the last 3 bytes of nvram are reserved for NVOFF_STATE, NVOFF_CHECKSUM
* and TOD clock
*/
/*
* state maintains the current validity of the tod clock and
* non-volatile ram
*/
#define NVOFF_STATE NVLEN_MAX
#define NVLEN_STATE 1
/*
* checksum is used by the power-on diagnostics to check the validity
* of the Non-Volatile RAM contents. let's put it at end of nvram.
*/
#define NVOFF_CHECKSUM (NVOFF_STATE+(NVLEN_STATE*NV_OFFSET))
#define NVLEN_CHECKSUM 1
#define NVCHECKSUM_ADDR (NVRAM_ADDR + NVOFF_CHECKSUM)
#define NVCHECKSUM_K1ADDR PHYS_TO_K1(NVCHECKSUM_ADDR)
#endif /* __SYS_CLOVER2_H__ */